package com.partsoft.dits;

/**
 * 监听启动模式
 */
public enum MonitorStartMode {
	
	AUTO(1, "自动启动"), 
	
	MANUAL(1<<1L, "手动启动"), 
	
	DISABLED(1<<2L, "禁用");
	
	private final int code;
	
	private final String title;
	
	public int getCode() {
		return code;
	}
	
	public String getTitle() {
		return title;
	}
	
	private MonitorStartMode(int code, String modetitle) {
		this.code = code;
		this.title = modetitle;
	}
	
	public static final MonitorStartMode fromCode(int code) {
		for (MonitorStartMode mode : MonitorStartMode.values()) {
			if (code == mode.code) return mode;
		}
		return null;
	}
}
